#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QVector>

namespace Ui { class MainWindow; }
class GameBoard;

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr, int initialPlayerCount = 2);
    ~MainWindow();

private slots:
    void onRollButtonClicked();
    void onResetButtonClicked();
    void onPlayerCountChanged(int index);

private:
    Ui::MainWindow *ui;
    GameBoard* m_gameBoard;

    int m_playerCount;
    int m_currentPlayer;
    QVector<int> m_positions;
    bool m_gameOver;

    void processDiceResult(int dice);
    void handleSpecialGrid(int type, int &position);
    void updateStatus();
    void showVictory();
};

#endif
